package xyz.xuminghai.javafx_learn.scene.control;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.stage.Stage;

/**
 * 2023/5/22 16:45 星期一<br/>
 * 选项卡窗格
 *
 * @author xuMingHai
 */
public class TabPaneApp extends Application {

    private final TabPane tabPane = new TabPane();

    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void init() {
        Tab tab1 = new Tab("tab1");
        Tab tab2 = new Tab("tab2");
        Tab tab3 = new Tab("tab3");

        tabPane.getTabs().addAll(tab1, tab2, tab3);
    }

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle(getClass().getSimpleName());
        Scene scene = new Scene(tabPane, 800, 600);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
